package com.sz.designpattern.create5.singleton.lazy;

public class SynSafeLazySingleton {
    private static SynSafeLazySingleton singleton = null;

    private SynSafeLazySingleton() {
    }

    public static synchronized SynSafeLazySingleton getInstance(){
        if (singleton == null){
            singleton = new SynSafeLazySingleton();
        }
        return singleton;
    }

//    public static SynSafeLazySingleton getInstance(){
//        synchronized (SynSafeLazySingleton.class){
//        if (singleton == null){
//            singleton = new SynSafeLazySingleton();
//        }
//        return singleton;
//        }
//    }
}
